/**
 * 自定义Map数据结构JS类
 */
function HashMap() {
	this.map = {};
	var length = 0; 
}

/**
 * 获取选择列表的记录，返回row，用for循环，row[i].xxx 取值
 */
function getSelectedRows() {
	var rowDatas = new Array();
	$.each(map.keySet(), function(index, key) {
		var selectedRow = map.get(key);
		rowDatas.push(selectedRow);
	});
	return rowDatas;
}

HashMap.prototype = {
	put : function(key, value) {
		this.map[key] = value;
		length ++;
	},
	get : function(key) {
		if (this.map.hasOwnProperty(key)) {
			return this.map[key];
		}
		return null;
	},
	remove : function(key) {
		if (this.map.hasOwnProperty(key)) {
			length --;
			return delete this.map[key];
		}
		return false;
	},
	removeAll : function() {
		this.map = {};
		length = 0;
	},
	keySet : function() {
		var _keys = [];
		for ( var i in this.map) {
			_keys.push(i);
		}
		return _keys;
	}
	,size : function() {
		return length;
	}
};
HashMap.prototype.constructor = HashMap;